#!/usr/bin/perl
#deljob.cgi

require './remotesync-lib.pl';
&ReadParse();
&error_setup($text{'error_mesg'});
#goto ERROR_OUT;
$cronline=$in{'sharedir'};
@conf_line=split(/ /, $in{'sharedir'});
$conf_ipmod=$conf_line[6];

open (FH, '/sysvol/etc/cronfile');
@cron_del=<FH>;
$cron_num_del=@cron_del;
close(FH);
unlink('/sysvol/etc/cronfile_tmp');

open(FHB, '>>/sysvol/etc/cronfile_tmp');
for($i=0; $i<$cron_num_del; $i++){
    if($cron_del[$i] ne $cronline){
         print FHB $cron_del[$i];
    }  
}
close(FHB);
unlink("/sysvol/etc/cronfile");
rename("/sysvol/etc/cronfile_tmp","/sysvol/etc/cronfile");
system('crontab /sysvol/etc/cronfile');
system('/etc/init.d/crond restart');
&redirect("index.cgi");
ERROR_OUT:
&error("abc");
